# 导入opencv依赖包
import cv2
import matplotlib.pylab as plt

avg = cv2.imread('./avg.jpg')

# plt.imshow(avg)
# 创建窗口
cv2.namedWindow('ShowWindows', cv2.WINDOW_NORMAL)
# 重置窗口大小
cv2.resizeWindow('window', 800, 600)

# 展示窗口
cv2.imshow('window', avg)

key = cv2.waitKey(0)
# key是int型至少4位
if key & 0xFF == ord('q'):
    print("准备销毁窗口")
    cv2.destroyAllWindows()
